import req from '@/untils/request'

import * as URL from '@/constants/api'
// 获取文章列表
export function getArticlesList(id) {
  return req({
    url: URL.ARTICLES_LIST,
    params: {
      channel_id: id,
      timestamp: Date.now(),
    }
  })
    .then(res => res.data.data.results)
    .catch(() => null)
}

export function getArticleContent(id) {
  return req({
    url: URL.ARTICLE_CONTENT + id,
  })
    .then(res => res.data.data)
    .catch(() => null)
}
